package com.atguigu.actual.edu0417.app;

import com.atguigu.actual.edu0417.unils.EnvUtil;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;

/**
 * @author: techyang
 * @since: 2023-10-20 09:02
 * @description: flinkSQL执行流程抽取
 **/
public abstract class SqlBaseApp {
    public void base(String[] args) {
        // 流执行环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        // 并行度,检查点相关设置
        EnvUtil.baseEnv(env);

        StreamTableEnvironment tableEnv = StreamTableEnvironment.create(env);

        // 业务逻辑处理
        process(tableEnv);

    }

    public abstract void process(StreamTableEnvironment tableEnv);
}
